﻿@model IEnumerable<RBS.Core.Model.Hotel.H_Hotel_Seat>
@{
    ViewBag.Title = "AddSeat";
    Layout = "~/Views/Shared/_UserLayout.cshtml";
}

<script>
    $(function () {
        $("#btnaddOrder").click(function () {
            var f_str = "";
            $(".ltable :radio[id='chkId']").each(function () {
                if (this.checked && this.value != "undefined") {
                    f_str += this.value + ',';
                }
            });
            $.dialog.confirm("删除记录后不可恢复，您确定吗？", function () {
                var url = '@Url.Action("AddSeatToOrder")?ids=' + f_str;
                $.ajax({
                    url: url,
                    type: "post",
                    dataType: 'json',
                    success: function (data) {
                        if (data.IsSuccess) {
                            $.dialog.alert(data.Msg); 
                        }
                        else { 
                            $.dialog.alert(data.Msg);
                        }
                    }
                });
            });
            return false;
        });

    });
</script>
<h2>选择餐桌</h2>

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
  <tr>
    <th width="8%">选择</th>
    			<th align="left"> Id</th>
				 
				  
					<th align="left"> 楼层</th>
					<th align="left"> 类别</th>
				 
					<th align="left"> 房号</th>
					<th align="left"> 台号</th>
					<th align="left"> 人数</th>
					<th align="left"> 图片</th> 
  </tr> 
@if (null != ViewData.Model)
{
    foreach (var item in ViewData.Model)
    {
  <tr>
    <td align="center"> 
         <input type="radio" id="chkId" value="@item.Id" class="checkall" style="vertical-align: middle;" /> 
                <input id="hidId" type="hidden" value="@item.Id"/> 
    </td>
         <td align="left"> 
			     @Html.DisplayFor(modelItem => item.Id)
			</td> 
				 
					<td align="left"> 
			     @Html.DisplayFor(modelItem => item.Floor)
			</td>
					<td align="left"> 
			     @Html.DisplayFor(modelItem => item.Category)
			</td>
				 
					<td align="left"> 
			     @Html.DisplayFor(modelItem => item.RoomNumber)
			</td>
					<td align="left"> 
			     @Html.DisplayFor(modelItem => item.Name)
			</td>
					<td align="left"> 
			     @Html.DisplayFor(modelItem => item.Numbers)
			</td>
					<td align="left"> 
			     @Html.DisplayFor(modelItem => item.Picture)
			</td> 
  </tr>
  } 
 }
</table> 

   <div class="page-footer">
        <div class="btn-list">
            <input type="button" id="btnaddOrder"  value="下一步" class="btn" />
            <input name="btnReturn" type="button" value="上一步" class="btn yellow" onclick="javascript: history.back(-1);" /> 
        </div>
        <div class="clear"></div>
    </div>
